import request from '@/utils/request'

/**
 * 获取区域列表
 * @param {pageIndex, pageSize, name} params 都是非必需
 * @returns Prommise
 */
export const getZoneListApi = params => request({
  url: '/api/vm-service/region/search',
  params
})
/**
 * 点位搜索
 * @param {pageIndex, pageSize, name, regionid} params
 * @returns Prommise
 */
export const getPTInfoApi = (params, data) => request({
  url: '/api/vm-service/node/search',
  params,
  data
})
/**
 *  修改区域
 * @param {*} id 区域id
 * @param {regionName , remark} data  区域名称 备注
 * @returns Prommise
 */
export const setAreaInfo = (id, data) => request({
  method: 'PUT',
  url: `/api/vm-service/region/${id}`,
  data
})
/**
 *  新增区域
 * @param {regionName , remark} data  区域名称 备注
 * @returns  Prommise
 */
export const addAreaIfo = data => request({
  method: 'POST',
  url: `/api/vm-service/region`,
  data
})
/**
 * 点位详情
 * @param {*} id 点位Id
 * @returns Prommise
 */
export const getPTDetailsApi = id => request({
  url: `/api/vm-service/node/vmList/${id}`
})
/**
 * 商圈列表
 * @returns Prommise
 */
export const getBusinessType = () => request({
  url: '/api/vm-service/businessType'
})
/**
 *  合作商搜索
 * @param { pageIndex, pageSize,name} params
 * @returns Prommise
 */
export const getPartnersInfo = params => request({
  url: '/api/user-service/partner/search',
  params
})
/**
 * 修改点位
 * @param {*} id
 * @param {*} data
 * @returns Prommise
 */
export const setPTDetailsApi = (id, data) => request({
  method: 'PUT',
  url: `/api/vm-service/node/${id}`,
  data
})
/**
 *  新增点位
 * @param {*} data
 * @returns Prommise
 */
export const addPTDetailsApi = data => request({
  method: 'POST',
  url: '/api/vm-service/node',
  data
})
